047 function blocks
您好,在本视频中,我们将学习如何在门户中创建功能块。
Hello, in this video, we are going to learn how to create a function block into a portal.
我将转到一个新博客,在这里您将看到功能博客。
I will go to a new blog and in here you will see the function blog.
好的,我们可以给这个函数博客命名为 F.P.。
OK, and we can give a name to this function blog as F.P..
这个函数的语言将是一个小图表。
And the language of this function will be a little diagram.
我会说,好的,这个函数被创建了,这个函数块需要一个数据块。
I will say, OK, and this function is created and this function block needs a data block.
我会说一个新博客,在这里您将看到数据块,在这里您将看到是否自动创建。
I will say a new blog, and in here you will see the data block and in here you will see if is created automatically.
我会说 F.P.
And I will say F.P.
我会说好的,这个功能块数据块是在功能块区域中创建的。
and I will say OK, and this function blocks data block is created in function block area.
你会看到我们有输入输出区域。
You will see we have input output area.
好的,例如,让我们说停止。
OK, for example, let's say stop.
这将是公牛。
And this will be bull.
好吧,让我们再说一次停止。
OK, let's say once more stop.
这将被计费并作为输出电机。
This will be billed and as output motor.
向前。
Forward.
好的,这很重要,这是输出的,我们如何将这些输入和输出写入程序区呢?
OK, this is important, this is Output's, and how can we write these inputs and outputs to program area?
我会来这里一个常开、常闭触点,一个常闭触点和一个输出。
I will come here one normal open, close contact, one normally close contact and one output.
我在这里只是开始。
And I will put here just my start.
好的,开始已创建并自动来到这里,让我们在这里停止。
OK, start is created and automatically came to here and let's put here stop.
好的,停止已自动创建并到达此处,电机继续前进。
OK, stop is automatically created and came here and motor forward.
好的,那么这些是我在功能块和数据块区域中的字母逻辑图,您将看到没有选择任何内容,我将对其进行编译,然后我将转到 Main Obi Wan,在这里我将把我的函数 willock 拖到此处和 drop 方法,它被分配到这里,我们可以创建一个像这样的数据块。
OK then these are the letter logic diagram for me in the function block and data block area you will see nothing is selected and I will compile it and I will go to Main Obi Wan and in here I will put my function willock to here the drag and drop method and it is assigned to here and we can create a data block like this.
我会说,好吧,首先 f.p.
And I will say, OK, first of all f.p.
db 或数据或两个是为此函数卧龙创建的。
db to or data or two is created for this function Wolong.
所以我会删除它。
So I will delete it.
这个功能是。
This function is.
不是。
Not.
好的,对我来说,因为我的函数博客被分配给数据就OK了,现在我们可以在这里说,例如,M零点零,这将是M零点一,输出将是,例如,Q零零点。
OK, for me, because my function blog is assigned to data to OK, and now we can say to here, for example, M zero point zero and this will be M zero point one and the output will be, for example, Q zero point zero.
好的,现在这个功能块已在 main 或 B 中创建并准备就绪,在 main 或 B 中您可以在数据块中看到它,您可以看到它的启动和停止以及为此建模。
OK, and now this function block is created and ready in the main or B in main or B you can see it in data block, you can see it start and stop and model for this.
所有这些都是自动创建的,好的,功能正常,我们可以上网到我的CPU。
All of them is created at automatically, OK, dysfunctionally is ready and we can go online to my CPU.
我会搜索我的CPU。
I will search my CPU.
现在正在寻找。
Now it's searching.
它已经找到了,我会上线。
And it's found it and I will go on line.
好的,现在我们需要下载这个项目或 CPU。
OK, now we need to do a download this project or CPU.
它正在编译配置。
It's compiling the configuration.
好吧,我会说继续不同步,我会说。
OK, I will say continue without synchronization and I will say.
首先,停止这一切,我会说,主啊,好吧,现在这个配置是根据我的 CPA,根据我的策略,我会说启动模块和 Disipio 将启动,我的功能块将在此处运行主要或区域。
First of all, stop all that and I will say, Lord, OK, now this configuration is according to my CPA, to my policy, and I will say start module and Disipio will be started and my function block will be running in here in the main or the area.
我会去监控,你会看到这是有效的。
I will go to monitoring and you will see this is working.
一切都是正确的。
Everything is correct.
如果我说启动已激活并且我们有一个输出,则输出将被激活。
And if I say start is activated and we have an output, output will be active.
再次,我需要去拿一张修改为一张。
And again, I need to go to take one to modify to one.
又真实又真实。
And true and true.
根据我们的算法,如果这个到来,并且如果它不活跃或不高,那么我们将要输出的输出可能不会再次如此真实和真实,以至于这是正确的。
And according to our algorithm, this if this comes and if this is not active or high, so we have an output I will go to may not be again so true and true that that's correct.
如果我激活零点一,会发生什么?
If I activate a zero point one, what will happen?
这将是错误的。
This will be false.
所以我的功能块正在工作。
So my function block is working.
线下我们可以做什么?
And what can we do offline?
例如,我们可以转到一个功能块,然后在此处添加一个输入。
We can go to a function block and we can add, for example, one more input to here, for example.
停下来喜欢这个,我们可以来这里。
Stop to like this and we can come here.
我们可以这样做,在这里我们可以说“停止”,“好”,我会的。
We can make it like this and in here we can say stop to OK and I will.
让它编译一下,然后我就上线了。
Make it compile to it and I will go online line.
然后会发生什么,它会比较它,我会下载它。
Then what will happen, it will compare it and I will do a download this to.
便宜了,现在重新初始化了很多。
Cheaper and now reinitialize and a lot.
现在我们的配置再次加载。
Now our configuration is loading again.
所以我们忘记了想要像我在函数博客中放入一个变量一样,但现在没关系,在主轨道上就可以了,我们会说什么?
So we forgot the wanting to put one variable like I am dropping to to my function blog, but it doesn't matter now, it's OK in the main orbit, what will we say?
Stop to 定义为此处。
Stop to is defined to here.
好的,这样就可以了。
OK, so this is working.
如果您在功能博客中更改任何内容,它会在 main 或 B 中更改,也会在所有地方更改。
If you change anything in the function blog, it will change in the main or B also it will change it everywhere.
我已经完成了这个功能块视频。
I am finished for this video for the function blocks.
我们将在接下来的视频中进行任何应用程序。
We will do any applications in the next videos.
但目前我们正在学习功能块的技术基础知识,我认为我们已经学会了。
But for a moment we are learning the technically the basics of the function blocks and I think we already learned.
在我完成这个视频之前,还有一件事,你会在这里看到我们使用了输入和输出,我们也可以使用输入和输出,好吧,状态和上下文常量以及这些暂时的时间并不重要进出你就可以工作了。
And one more thing before I finish this video and you will see in here we used inputs and outputs also we can use in and out, OK, and the status and the context constants and the times these are for a moment, doesn't matter in and out that you can work.
这也会出现在内部输入和输出上。
This will appear on the inside inputs and outputs also.
但对于输入和输出来说,这确实是功能块的基础知识。
But for inputs and outputs, this is really, really, really basics of the function blocks.
我已经完成这个视频了。
I am finished for this video.
下一个视频见。
See you in the next video.